package eclipse.server.data;
/** 
 * Represends a Character object.
 */
public class Character
{
	/** The names of all of the stats. */
	public static String[] 	STAT_NAME 			= new String[6];
	/** The maximum number of items that a Character can hold. */
	public static int		MAX_PLAYER_INV;
	/** The maximum number of Spells that a Character can learn. */
	public static int		MAX_PLAYER_SPELLS;
	
	private String name;
	private int 	HP;
	private int 	MP;
	private int		SP;
	private int 	STR;
	private int		DEF;
	private int		SPD;
	private int		MGC;
	private int[] 	inventory;
	private int[] 	spell;
	
	/**
	 * Creates a new Character
	 * @param name Name of the character.
	 */
	public Character(String name /*,class*/ )
	{
		inventory 	= new int[MAX_PLAYER_INV];
		spell 		= new int[MAX_PLAYER_SPELLS];
		setName(name);
		//TODO: Generate character from class arctype
	}
	/**
	 * Sets the name of a stat.
	 * @param stat Index of the stat that will be modified.
	 * @param name New name of the stat.
	 */
	public static void setStatName(int stat, String name)
	{
		if(stat < 4 && stat >= 0)
			STAT_NAME[stat] = name;
	}
	/**
	 * Returns the name of a stat.
	 * @param stat stat Index of the stat that will be modified.
	 */
	public static String getStatName(int stat)
	{
		if(stat < 4 && stat >= 0)
			return STAT_NAME[stat];
		else
			return "";
	}
	/**
	 * Sets the name of the Character
	 * @param newName String that will be set as the new name of the Character.
	 */
	public void setName(String newName)
	{
		name = newName;
	}
	/**
	 * Returns the name of the Character.
	 */
	public String getName()
	{
		return name;
	}	
	/**
	 * Sets the HP value of the Character
	 * @param value Value to overwrite the HP value.
	 */
	public void setHP(int value)
	{
		HP = value;
	}
	/** Returns the HP of the Character */
	public int getHP()
	{
		return HP;
	}
	/**
	 * Sets the MP of the Character
	 * @param value Value to overwrite the Character's MP value.
	 */
	public void setMP(int value)
	{
		MP = value;
	}
	/** Returns the MP of the Character */
	public int getMP()
	{
		return MP;
	}
	/**
	 * Sets the SP of the Character
	 * @param value Value to overwrite the Character's SP value.
	 */
	public void setSP(int value)
	{
		SP = value;
	}
	/**
	 * Returns the SP of the Character
	 */
	public int getSP()
	{
		return SP;
	}
	/**
	 * Sets the STR of a character.
	 * @param value Value to overwrite the Character's STR value.
	 */
	public void setSTR(int value)
	{
		STR = value;
	}
	/** Returns the STR of a Character. */
	public int getSTR()
	{
		return STR;
	}
	/**
	 * Sets the DEF of a character.
	 * @param value Value to overwrite the Character's DEF value.
	 */
	public void setDEF(int value)
	{
		DEF = value;
	}
	/** Returns the DEF of a character. */
	public int getDEF()
	{
		return DEF;
	}
	/**
	 * Sets the speed of a character.
	 * @param value Value to overwrite the Character's Speed
	 */
	public void setSpeed(int value)
	{
		SPD = value;
	}
	/** Returns the speed of a character. */
	public int getSpeed()
	{
		return SPD;
	}
	/** 
	 * Sets the Magic of a character.
	 * @param value Value to overwrite the Character's magic.
	 */
	public void setMagic(int value)
	{
		MGC = value;
	}
	/** Returns the magic of a character. */
	public int getMagic()
	{
		return MGC;
	}
	/** 
	 * Sets the Inventory of a character.
	 * @param slot Inventory slot value.
	 * @param value Item value.
	 */
	public void setInventory(int slot, int value)
	{
		inventory[slot] = value;
	}
	/** Returns the ItemValue of a Character's inventory slot. */
	public int getInventory(int slot)
	{
		return inventory[slot];
	}
	/** 
	 * Sets the Spell of a character.
	 * @param slot Spell slot value
	 * @param value Spell value.
	 */
	public void setSpell(int slot, int value)
	{
		spell[slot] = value;
	}
	/** Returns the Spell value of a Character's Spell slot. */
	public int getSpell(int slot)
	{
		return spell[slot];
	}
}
